package edu.virginia.cs4501.team22;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Window;

public class Splash extends Activity {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.splash);
		Thread splashThread = new Thread() {
			@Override
			public void run() {
				try {
					int waited = 0;
					while (waited < 5000) {
						sleep(100);
						waited += 100;
					}
				} catch (InterruptedException e) {
					// do nothing
				} finally {
					finish();
					Intent i = new Intent();
					i.setClassName("edu.virginia.cs4501.team22", "edu.virginia.cs4501.team22.MainTab");
					try {
						startActivity(i);
					}
					catch (Throwable t) {
						Log.i("SPLASH FAIL!", t.toString());
					}


				}
			}
		};
		splashThread.start();
	}
}
